package com.txhy.certificatechain.ui.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.txhy.certificatechain.R;
import com.txhy.certificatechain.model.bean.FrgHomeBean;

import java.util.ArrayList;

/*
 * -----------------------------------------------------------------
 * Copyright (C) 2018-2030, by your company, All rights reserved.
 * -----------------------------------------------------------------
 * 文    件: FragHomeGdThreeAdapter.java
 * 作    者: 侯建军
 * 版    权: 1.0.0
 * 描    述:
 * 创建时间: 2018/9/20 8:20
 * 更新时间：2018/9/20 8:20
 * -----------------------------------------------------------------
 * 2018/9/20 8:20: 创建 FragHomeGdThreeAdapter.java (侯建军);
 * -----------------------------------------------------------------
 */
public class FragHomeGdThreeAdapter extends BaseAdapter {
    private ArrayList<FrgHomeBean> list;
    private Context context;

    public FragHomeGdThreeAdapter(ArrayList<FrgHomeBean> list, Context context) {
        this.list = list;
        this.context = context;
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = View.inflate(context, R.layout.item_home_three, null);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
//        holder.tex_name.setText(list.get(position).getImageName());
//        holder.img_image.setImageResource(list.get(position).getImageId());
        return convertView;
    }
    static class ViewHolder {
        TextView tex_name;
        ImageView img_image;
    }
}


